<template>
  <div>
    <!--典藏赏析-->
    <content-header :title="routeItem.title"></content-header>
    <div class="xui-fc">
      <div v-for="(item,index) in listData" class="list xui-margin-right-sm" :key="index">
        <a :href="item.d3Addr" target="_blank">
          <div class="list__img xui-margin-xs">
            <img-box
              :width="202"
              :height="212"
              :imgSrc="item.picUrl"
            >
            </img-box>
          </div>
          <div class="list__text">
            <h4 class="xui-text-truncate">{{item.name}}</h4>
            <p class="color-darken-gray"><i class="el-icon-location color-primary xui-margin-right-xs"></i>{{item.layerName}} {{item.hallName}}</p>
            <p class="xui-text-truncate-line-2 xui-margin-top-xs" >{{item.introduce | truncate(25)}}</p>
          </div>
        </a>
      </div>
    </div>
  </div>
</template>

<script>
import ContentHeader from "../../../components/widge/content-header";
import HalfList from "@/components/list/half-width-list";
import { getAppreciateList } from "@/api/list";
import imgBox from "@/components/widge/img-box";

export default {
  components: {
    "half-list": HalfList,
    "content-header": ContentHeader,
    imgBox
  },
  data() {
    return {
      listData: []
    };
  },
  computed: {
    routeItem() {
      let routes = this.$store.getters.siteMap;
      let result;
      routes.forEach(route => {
        if (route.children) {
          route.children.forEach(child => {
            if (child.name == this.$route.name) {
              result = child;
            }
          });
        }
      });
      return result;
    },
    routePath() {
      return this.$route.path;
    }
  },
  mounted() {
    getAppreciateList().then(res => {
      this.listData = res.data.recordsList;
    });
  }
};
</script>

<style lang='less' scoped>
.list {
  width: 448px;
  height: 228px;
  position: relative;
  /*margin-right: 30px;*/
  margin-top: 20px;
  float: left;
}

.list:nth-child(even) {
  margin-right: 0;
}

.list a {
  width: 448px;
  height: 228px;
  display: block;
  cursor: pointer;
  border: 2px solid #d2d2d2;
}

.list > a > div {
  float: left;
}

.list a:hover {
  border: 2px solid #dea630;
}

.list .list__text {
  width: calc(100% - 60px);
  position: absolute;
  top: 50%;
  right: 40px;
  margin-top: -69px;
}

.list .list__text h4 {
  font-size: 18px;
  font-weight: normal;
  margin-bottom: 15px;
}

.list .list__text span,
p {
  font-size: 14px;
  color: #b4b4b4;
}

.list .list__text span {
  display: block;
  margin-bottom: 5px;
  background: url("../../../assets/images/list/dot.png") no-repeat 0;
  padding-left: 15px;
}
</style>




